let someValue: any = "Hello, world!";

// 使用尖括号语法进行类型断言
let strLength: number = (<string>someValue).length;

// 使用as关键字语法进行类型断言
let strLengthAs: number = (someValue as string).length;